export type accountReqPramesType = {
    username?: string,
    phone?: string,
    account?: string
}

export type userType= {
    userId:number,
    account:string
}

export type accountStateType = {
    prames: accountReqPramesType,
    data: accountResType,
    addOrEdit: boolean,
    user: userType,
    type: 'add' | 'edit'
}

export type accountReducerType = { type: "SET_PRAMES", payLoad: accountReqPramesType } |
{ type: "CLEAR_PRAMES" } |
{ type: "SET_RESDATA", payLoad: accountResType } |
{ type: "CHANGE_ADDOREDIT", payLoad: boolean } |
{ type: "SET_ID", payLoad: userType } |
{ type: "SET_TYPE", payLoad: 'add' | 'edit' };


export type contextType = { state: accountStateType, dispatch: React.Dispatch<accountReducerType> }


export type accountPaginationType = {
    page: number,
    size: number
}

export interface accountReqType extends accountReqPramesType {
    paging: accountPaginationType
}

export type accountResDataType = {
    userId: number;
    username: string;
    account: string;
    phone: string;
    createTime: number;
    updateTime: number;
    remark: string;
    state: number;
    password: string;
}

export type accountResType = {
    count: number,
    list: accountResDataType[]
}

export type accountFormType = {
    username: string,
    account: string,
    phone: string,
    remark: string,
    state: 1 | 2,
    roleId: number[],
    type: number,
    password?:string
}

export type accountReqFormType = {
    userId?: number,
    username: string,
    account: string,
    phone: string,
    remark: string,
    state: 1 | 2,
    roleId: number[],
    type: number,
    password?:string
}